import 'package:fate_blind_box/theme/theme_color.dart';
import 'package:fate_blind_box/ui/Home/activity/sign_up/sign_up_list_model.dart';
import 'package:fate_blind_box/utils/common_widget.dart';
import 'package:fate_blind_box/widget/icon_text.dart';
import 'package:flutter/material.dart';

class ActSignItemView extends StatelessWidget {
  SignUpListDataModel? signUpListDataModel;

  ActSignItemView({this.signUpListDataModel, Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    signUpListDataModel ??= SignUpListDataModel();
    String profilePhoto = signUpListDataModel?.profilePhoto ?? '';
    bool isNan = signUpListDataModel?.realSex == 1;
    return Column(
      children: [
        Padding(
          padding: const EdgeInsets.only(left: 16, right: 14),
          child: Row(
            children: [
              AppWidget.blurFixImage(
                  url: profilePhoto,
                  imgWidth: 50,
                  sign: signUpListDataModel?.sign ?? 0),
              const SizedBox(
                width: 8,
              ),
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    signUpListDataModel?.nickName ?? '',
                    style: TextStyle(
                        fontSize: 16, color: ThemeColor.gray3A3A3AColor),
                  ),
                  SizedBox(
                    height: 8,
                  ),
                  Row(
                    children: [
                      Container(
                        width: 40,
                        height: 14,
                        decoration: BoxDecoration(
                          color:
                              isNan ? ThemeColor.nanColor : ThemeColor.appColor,
                          borderRadius: BorderRadius.circular(7),
                        ),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Icon(
                              isNan ? Icons.male : Icons.female,
                              color: Colors.white,
                              size: 15,
                            ),
                            IconText(
                              '${signUpListDataModel?.age ?? 0}',
                              style:
                                  TextStyle(color: Colors.white, fontSize: 10),
                            )
                          ],
                        ),
                      ),
                      SizedBox(
                        width: 5,
                      ),
                      Text(
                        '二度粉丝（${signUpListDataModel?.erFansNumber}）人',
                        style: TextStyle(
                            color: ThemeColor.grayA7A7A7Color, fontSize: 12),
                      )
                    ],
                  )
                ],
              ),
              Expanded(child: Container()),
              Text(
                signUpListDataModel?.enrollTime ?? '',
                style:
                    TextStyle(color: ThemeColor.grayA0A0A0Color, fontSize: 12),
              )
            ],
          ),
        ),
        SizedBox(
          height: 10,
        ),
        Container(
          height: 8,
          color: ThemeColor.sendMsgColor,
        ),
      ],
    );
  }
}
